package com.hqq.queue;

import com.hqq.queue.service.QueueProducer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * ProducerMain
 * Created by heqianqian on 2018/1/20.
 */
public class ProducerMain {
    private static final Logger logger = LoggerFactory.getLogger(ProducerMain.class);

    public static void main(String[] args) {
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("queue/producer.xml");
        QueueProducer queueProducer = (QueueProducer) context.getBean("queueProducer");
        for (int i = 0; i < 100; i++) {
            queueProducer.sendMessage("Queue-Message" + i);
        }
        context.close();
    }
}
